<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{height: 2000px;}
        html::-webkit-scrollbar{
            width: 10px;
        }
        html::-webkit-scrollbar-thumb{
            background: orange;
            border-radius: 15px;
        }
        html::-webkit-scrollbar-track{
            background: wheat;
            box-shadow: inset 0 0 5px gray;
        }


        *{margin: 0;padding: 0;}
        ul{list-style: none;}
        #main{
            width: 600px;height: 100px;border: 1px black solid;margin: 100px;overflow: auto;
            scroll-snap-type: x mandatory;
        }
        #main ul{width: 2000px;}
        #main ul li{
            width: 300px;height: 100px;background: red;float: left;margin: 0 10px;
            scroll-snap-align: start;
        }
    </style>
</head>
<body>
    <!--自定义滚动条-->
    <!--滚动捕捉  scrollsnap-->
    <div id="main">
        <ul>
            <li>3423</li>
            <li>3423</li>
            <li>3423</li>
            <li>3423</li>
            <li>3423</li>
        </ul>
    </div>
</body>
</html>